#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
#include<stdlib.h>
int cmp(const void* p1, const void* p2) {
	return *(int*)p1 - *(int*)p2;
}
void Single_Dog(int* arr, int sz)
 {
	qsort(arr, sz, sizeof(int), cmp);
	int slow=0, fast=1;
	while (fast < sz)
	{
		if (arr[slow] == arr[fast]) {
			slow++; fast++;
		}
		else {
			if ((fast + 1) < sz && (arr[fast] == arr[fast + 1])) {
				fast++; slow++;
			}
			else {
				cout << arr[fast] << " ";
				slow++; fast++;
			}
		}
	}
}
void print(int* arr, int sz) {
	int i = 0;
	for (i = 0; i < sz; i++)
	{
		cout << arr[i] << " ";
	}
	cout << endl;
}
int main()
{
	int arr[] = { 1,2,3,4,5,6,1,1,1,2,2,3,3,4,7,7,8,8,8,9 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	Single_Dog(arr, sz);
	//print(arr, sz);
	system("pause");
}